<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是天猫蓝牙Mesh项目——初级开发 端-硬件开发 的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发">
<meta property="og:url" content="https://sumumm.github.io/post/1dba287.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是天猫蓝牙Mesh项目——初级开发 端-硬件开发 的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/TLSR8258%E6%A8%A1%E5%9D%97.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%99%A8%E5%92%8C8258.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230100733856.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230101018515.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230104230800.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85python1.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85python2.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85python3.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85python4.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85python5.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85python6.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%B5%8B%E8%AF%95python.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%B5%8B%E8%AF%95python1.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube1.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube2.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube3.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube4.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube5.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube6.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube7.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85aos%20cube8.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code1.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code2.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code3.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code4.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code5.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code6.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%AE%89%E8%A3%85VS%20Code7.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/VS%20Code%E9%85%8D%E7%BD%AE1.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/VS%20Code%E9%85%8D%E7%BD%AE2.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/VS%20Code%E9%85%8D%E7%BD%AE3.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK%E5%AE%89%E8%A3%85.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK%E5%AE%89%E8%A3%851.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK%E5%AE%89%E8%A3%852.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK%E5%AE%89%E8%A3%853.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK%E5%AE%89%E8%A3%854.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK%E5%AE%89%E8%A3%855.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%851.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%852.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%853.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%854.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%855.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%856.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E6%97%B6%E9%92%9F.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%9F%A5%E7%9C%8B%E6%B3%A2%E7%89%B9%E7%8E%87%E9%85%8D%E7%BD%AE.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%94%9F%E6%88%90helloworld%E7%A8%8B%E5%BA%8F.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%94%9F%E6%88%90helloworld%E7%A8%8B%E5%BA%8F1.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%A1%AC%E4%BB%B6%E6%8E%A5%E7%BA%BF.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E5%AE%89%E8%A3%851.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E5%AE%89%E8%A3%852.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A81.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A82.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A83.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A84.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A85.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A86.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%9F%A5%E7%9C%8B%E7%AB%AF%E5%8F%A3%E5%8F%B7.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E6%89%93%E5%8D%B01.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E6%89%93%E5%8D%B02.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%B2%E5%8F%A3%E6%89%93%E5%8D%B03.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/TLSR8258%E6%A8%A1%E5%9D%97%E8%B5%84%E6%96%99.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230105319303.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E9%A3%8E%E6%89%87.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/L9110%E9%A3%8E%E6%89%87%E6%A8%A1%E5%9D%97.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/L9110%E5%BC%95%E8%84%9A%E5%AE%9A%E4%B9%891.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/L9110%E5%BC%95%E8%84%9A%E5%AE%9A%E4%B9%892.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%8E%A7%E5%88%B6%E7%94%B5%E8%B7%AF.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E5%BC%95%E5%87%BA%E7%AB%AF%E6%B3%A2%E5%BD%A2.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230110454170.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E6%8C%89%E9%94%AE.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/%E4%B8%87%E7%94%A8%E8%A1%A8%E4%BD%BF%E7%94%A8.jpg">
<meta property="article:published_time" content="2024-01-07T03:45:51.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.028Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV21-天猫精灵IOT">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/TLSR8258%E6%A8%A1%E5%9D%97.jpg">


<link rel="canonical" href="https://sumumm.github.io/post/1dba287.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/1dba287.html","path":"post/1dba287.html","title":"LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81%E6%B3%B0%E5%87%8C%E5%BE%AETLSR8258"><span class="nav-text">一、泰凌微TLSR8258</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E6%A8%A1%E5%9D%97%E5%AE%9E%E7%89%A9%E5%9B%BE"><span class="nav-text">1. 模块实物图</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-TLSR8258-SOC%E6%A1%86%E5%9B%BE"><span class="nav-text">2. TLSR8258 SOC框图</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"><span class="nav-text">二、开发环境搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-SDK%E4%B8%8B%E8%BD%BD"><span class="nav-text">1. SDK下载</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83"><span class="nav-text">2. 开发环境</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA"><span class="nav-text">3. 环境搭建</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-python%E5%AE%89%E8%A3%85"><span class="nav-text">3.1 python安装</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-1-1-python%E4%B8%8B%E8%BD%BD"><span class="nav-text">3.1.1 python下载</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-1-2-%E5%AE%89%E8%A3%85%E6%AD%A5%E9%AA%A4"><span class="nav-text">3.1.2 安装步骤</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-1-3-%E9%AA%8C%E8%AF%81%E6%98%AF%E5%90%A6%E5%AE%89%E8%A3%85%E6%88%90%E5%8A%9F"><span class="nav-text">3.1.3 验证是否安装成功</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-aos-cube%E5%AE%89%E8%A3%85"><span class="nav-text">3.2 aos-cube安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-VS-Code"><span class="nav-text">3.3 VS Code</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-3-1-vscode%E4%B8%8B%E8%BD%BD"><span class="nav-text">3.3.1 vscode下载</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-3-2-%E5%AE%89%E8%A3%85%E8%BD%AF%E4%BB%B6"><span class="nav-text">3.3.2 安装软件</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-3-3-%E9%85%8D%E7%BD%AEVS-Code-%E4%B8%AD%E6%96%87"><span class="nav-text">3.3.3 配置VS Code 中文</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-3-4-%E9%85%8D%E7%BD%AEVS-Code-C-C-%E6%8F%92%E4%BB%B6"><span class="nav-text">3.3.4 配置VS Code C&#x2F;C++插件</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-4-SDK%E5%AE%89%E8%A3%85"><span class="nav-text">3.4 SDK安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-5-%E4%B8%B2%E5%8F%A3%E9%A9%B1%E5%8A%A8%E5%AE%89%E8%A3%85"><span class="nav-text">3.5 串口驱动安装</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E5%B7%A5%E7%A8%8B%E7%BC%96%E8%AF%91"><span class="nav-text">4. 工程编译</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-1-%E6%9F%A5%E7%9C%8Bhelloworld%E5%B7%A5%E7%A8%8B"><span class="nav-text">4.1 查看helloworld工程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-%E7%BC%96%E8%AF%91%E5%B7%A5%E7%A8%8B"><span class="nav-text">4.2 编译工程</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-%E7%83%A7%E5%BD%95%E7%A8%8B%E5%BA%8F"><span class="nav-text">5. 烧录程序</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#5-1-%E7%83%A7%E5%BD%95%E7%A1%AC%E4%BB%B6%E6%8E%A5%E7%BA%BF"><span class="nav-text">5.1 烧录硬件接线</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-2-%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E5%AE%89%E8%A3%85"><span class="nav-text">5.2 烧录工具安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-3-%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8"><span class="nav-text">5.3 烧录工具使用</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-%E7%A8%8B%E5%BA%8F%E7%8E%B0%E8%B1%A1"><span class="nav-text">6. 程序现象</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E7%A1%AC%E4%BB%B6%E6%8E%A7%E5%88%B6"><span class="nav-text">三、硬件控制</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-LED%E6%8E%A7%E5%88%B6%E5%AE%9E%E9%AA%8C"><span class="nav-text">1. LED控制实验</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-LED%E6%8E%A5%E5%9C%A8%E5%93%AA%EF%BC%9F"><span class="nav-text">1.1 LED接在哪？</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-LED%E4%BA%AE%E7%81%AD%E5%9F%BA%E6%9C%AC%E5%8E%9F%E7%90%86"><span class="nav-text">1.2 LED亮灭基本原理</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-LED%E6%8E%A7%E5%88%B6%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0"><span class="nav-text">1.3 LED控制代码实现</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E9%A3%8E%E6%89%87%E6%8E%A7%E5%88%B6%E5%AE%9E%E7%8E%B0"><span class="nav-text">2. 风扇控制实现</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E9%A3%8E%E6%89%87%E5%AE%9E%E7%89%A9%E5%9B%BE"><span class="nav-text">2.1 风扇实物图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E5%90%84%E9%83%A8%E5%88%86%E8%AF%B4%E6%98%8E"><span class="nav-text">2.2 各部分说明</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-3-%E9%A3%8E%E6%89%87%E7%94%B5%E6%9C%BA%E9%A9%B1%E5%8A%A8%E5%8E%9F%E7%90%86"><span class="nav-text">2.3 风扇电机驱动原理</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#2-3-1-L9110%E8%8A%AF%E7%89%87%E7%89%B9%E6%80%A7"><span class="nav-text">2.3.1 L9110芯片特性</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-3-2-L9110%E5%BC%95%E8%84%9A%E5%AE%9A%E4%B9%89"><span class="nav-text">2.3.2 L9110引脚定义</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-3-3-%E6%8E%A7%E5%88%B6%E7%94%B5%E8%B7%AF"><span class="nav-text">2.3.3 控制电路</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-4-%E5%AE%9E%E7%8E%B0%E9%A3%8E%E6%89%87%E6%8E%A7%E5%88%B6"><span class="nav-text">2.4 实现风扇控制</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-1-GPIO%E5%BC%95%E8%84%9A%E9%80%89%E6%8B%A9"><span class="nav-text">2.4.1 GPIO引脚选择</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-2-%E5%AE%9E%E7%8E%B0PWM%E7%9B%B8%E5%85%B3%E5%87%BD%E6%95%B0"><span class="nav-text">2.4.2 实现PWM相关函数</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-4-3-PWM%E5%88%9D%E5%A7%8B%E5%8C%96%E5%92%8C%E6%8E%A7%E5%88%B6%E5%AE%9E%E7%8E%B0"><span class="nav-text">2.4.3 PWM初始化和控制实现</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E6%8C%89%E9%94%AE%E4%B8%AD%E6%96%AD%E5%AE%9E%E7%8E%B0"><span class="nav-text">3. 按键中断实现 </span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E5%BC%80%E5%8F%91%E6%9D%BF%E4%B8%AD%E7%9A%84%E6%8C%89%E9%94%AE"><span class="nav-text">3.1 开发板中的按键</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E4%B8%87%E7%94%A8%E8%A1%A8%E5%AE%9E%E6%B5%8B%E5%BC%95%E8%84%9A"><span class="nav-text">3.2 万用表实测引脚</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E5%AE%9E%E7%8E%B0%E6%8C%89%E9%94%AE%E8%A7%A6%E5%8F%91"><span class="nav-text">3.3 实现按键触发</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/1dba287.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2024-01-07 11:45:51" itemprop="dateCreated datePublished" datetime="2024-01-07T11:45:51+08:00">2024-01-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" itemprop="url" rel="index"><span itemprop="name">LV21-天猫精灵IOT</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>12k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>44 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是天猫蓝牙Mesh项目——初级开发 端-硬件开发 的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows版本</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu版本</td>        <td align="left">Ubuntu22.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="6">官方网站</td>        <td align="left"><a href="https://cn.aliyun.com/" target="_blank">阿里云</a></td>        <td align="left">阿里云官网主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/livinglink?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.317.5421154acZniIL&scm=20140722.X_data-1da961ea118f5bb0e4b2._.V_1" target="_blank">阿里生活物联平台</a></td>        <td align="left">生活物联网平台(飞燕平台)主页</td>    </tr>    <tr>        <td align="left"><a href="https://iap.aligenie.com/?spm=0.7629140.0.0.2c611780Ty6tzg" target="_blank">AliGenie</a></td>        <td align="left">天猫精灵开放平台AliGenie主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/iot_instc_public_cn?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.81.5421154au3ocqp&scm=20140722.X_data-9349178ba84cf028806a._.V_1" target="_blank">阿里物联网平台</a></td>        <td align="left">阿里物联网平台主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/" target="_blank">Bluetooth 技术网站</a></td>        <td align="left">蓝牙协议规范什么的可以来这里找</td>    </tr>    <tr>        <td align="left"><a href="https://www.telink-semi.com/" target="_blank">Telink</a></td>        <td align="left">Telink | Chips for a Smarter IoT (telink-semi.com)<br><a href="https://www.telink-semi.cn/" target="_blank">Telink中文官网</a></td>    </tr>    <tr>        <td align="center" rowspan="5">开发手册</td>        <td align="left"><a href="https://help.aliyun.com/zh/alios-things/" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things开发指南，这里是最新版本，可以直接从官网找到</td>    </tr>     <tr>        <td align="left"><a href="https://haas.iot.aliyun.com/aliosthings/index.html" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.3版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://gaic.alicdn.com/aic/h5_daily/test/aliosthings/3.0.13/index.html" target="_blank">AliOS Things开发指南(3.0)</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.0版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/product/123207.html?spm=a2c4g.11186623.6.540.114e60d84sF58G" target="_blank">生活物联网平台开发文档</a></td>        <td align="left">生活物联网平台（飞燕平台）开发文档<br><a href="https://help.aliyun.com/document_detail/180778.html?spm=a2c4g.123207.0.0.49556adcO5apvd" target="_blank">《设备端开发指南》</a></td>    </tr>    <tr>        <td align="left"><a href="https://doc-bot.tmall.com/docs/doc.htm?spm=0.7629140.0.0.7bf81780UN7WkQ&treeId=578&articleId=118057&docType=1" target="_blank">Wi-Fi IoT品类定义与功能开发</a></td>        <td align="left">天猫精灵IoT开放平台——Wi-Fi IoT品类定义与功能开发</td>    </tr>    <tr>        <td align="center" rowspan="3">硬件平台</td>        <td align="left"><a href="https://developer.aliyun.com/article/761644?spm=a2c6h.12873581.0.dArticle761644.1c1b589dRHgvcR&groupCode=genieaiot" target="_blank">mk3080 WiFi开发板</a></td>        <td align="left">WiFi开发板使用指南-阿里云开发者社区</td>    </tr>    <tr>        <td align="left"><a href="http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/esp8266-nodemcu-tutorial-index/" target="_blank">esp8266开发板</a></td>        <td align="left">一个教程：ESP8266-NodeMCU开发板详解-太极创客 (taichi-maker.com)</td>    </tr>    <tr>        <td align="left"><a href="https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet%20for%20Telink%20BLE+IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8258.pdf" target="_blank">TLSR8258 Datasheet</a></td>        <td align="left">Datasheet for Telink BLE + IEEE802.15.4 MultiStandard Wireless SoC TLSR8258</td>    </tr>    <tr>        <td align="center" rowspan="2">参考资料</td>        <td align="left"><a href="https://developer.aliyun.com/article/720516#" target="_blank">AliOS Things 3.0 应用开发指南</a></td>        <td align="left">这个只是一篇参考文章，里面是一些环境搭建相关的，可以参考</td>    </tr>    <tr>        <td align="left"><a href="https://info.support.huawei.com/info-finder/encyclopedia/zh/index.html" target="_blank">IP知识百科 - 华为 (huawei.com)</a></td>        <td align="left">IP的一些相关知识点</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="left" rowspan="6">蓝牙规范相关文档</td>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/core-specification-5-2/" target="_blank">Core Specification 5.2</a></td>        <td align="left">核心规格 5.2，该规范定义了创建可互操作的Bluetooth 设备所需的技术。                        <br><a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-model-1-1/" target="_blank">Mesh Model(v1.1)</a></td>        <td align="left">本Bluetooth 规范定义了模型（以及它们所需的状态和消息），这些模型用于在mesh 网络中的节点上执行基本功能，超出了Bluetooth Mesh 配置文件 规范中定义的基础模型。                        <br>本规范包括定义跨设备类型标准功能的通用模型，以及支持关键mesh 场景的模型，如照明控制、传感器、时间和场景。                        <br><a href="./蓝牙参考资料/MshMDL_v1.1.pdf" target="_blank">《MshMDL_v1.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-profile-1-0-1/" target="_blank">Mesh Profile(v1.0.1)</a></td>        <td align="left">该Bluetooth 规范定义了基本要求，以实现可互操作的mesh 网络解决方案，用于Bluetooth 低能量无线技术。                        <br><a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/device-properties/" target="_blank">Mesh Device Properties</a></td>        <td align="left">本规范包含Bluetooth Mesh 配置文件 和Bluetooth Mesh 模型规范所要求的设备属性的定义。                        <br>但是跟之前的有些区别，我主要看的之前的版本：<a href="./蓝牙参考资料/MeshDeviceProperties_v1.2.pdf" target="_blank">《MMeshDeviceProperties_v1.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/gss/" target="_blank">GATT Specification Supplement</a></td>        <td align="left">GATT Specification Supplement | Bluetooth® Technology Website。                        <br>好像可以在线看：<a href="https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf" target="_blank">《GATT Specification Supplement》</a></td>      </tr>     <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/assigned-numbers/" target="_blank">Assigned Numbers</a></td>        <td align="left">GATT的一些类型定义可以在这里找。</td>      </tr>    <tr>        <td align="left" rowspan="2">AliOS Things</td>        <td align="left"><a href="https://gitee.com/alios-things-admin/AliOS-Things" target="_blank">alios-things/AliOS-Things</a></td>        <td align="left">Gitee上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left"><a href="https://github.com/alibaba/AliOS-Things" target="_blank">alibaba/AliOS-Things</a></td>        <td align="left">GitHub上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left" rowspan="2">天猫精灵蓝牙Mesh协议栈</td>        <td align="left"><a href="https://github.com/alibaba-archive/genie-bt-mesh-stack" target="_blank">alibaba-archive/genie-bt-mesh-stack</a></td>        <td align="left">GitHub上的天猫精灵蓝牙Mesh协议栈源码仓库。<br>之前是在<a href="https://github.com/alibaba/genie-bt-mesh-stack"target="_blank">alibaba/genie-bt-mesh-stack</a>这个仓库。<br>写笔记的时候最新提交为<a href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a" target="_blank">faf523618a6a2560090fc423222b9db80984bb7a</a></td>      </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/document_detail/171552.html?spm=a2c4g.173310.0.0.55d6e992e8xJip" target="_blank">蓝牙Mesh设备开发指南</a></td>        <td align="left">阿里云生活服务平台开发手册——蓝牙设备开发一节中的内容</td>      </tr></table>
              </div>
            </details>

<p>这一LV的笔记起始跟前面有所重叠，互相补充吧算是。</p>
<h1 id="一、泰凌微TLSR8258"><a href="#一、泰凌微TLSR8258" class="headerlink" title="一、泰凌微TLSR8258"></a><font size=3>一、泰凌微TLSR8258</font></h1><h2 id="1-模块实物图"><a href="#1-模块实物图" class="headerlink" title="1. 模块实物图"></a><font size=3>1. 模块实物图</font></h2><p>泰凌微8258芯片手册可以在线查阅：[DS_TLSR8258-E_Datasheet for Telink BLE+IEEE802.15.4 Multi-Standard Wireless SoC TLSR8258.pdf (telink-semi.cn)](<a target="_blank" rel="noopener" href="https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet">https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet</a> for Telink BLE+IEEE802.15.4 Multi-Standard Wireless SoC TLSR8258.pdf)，他就是下图中左侧扣开盖板后里面的这个芯片：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/TLSR8258模块.jpg" alt="TLSR8258模块" style="zoom:25%;" />

<p>给这个开发板下载程序需要使用烧录器：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录器和8258.jpg" alt="烧录器和8258" style="zoom:25%;" />

<h2 id="2-TLSR8258-SOC框图"><a href="#2-TLSR8258-SOC框图" class="headerlink" title="2. TLSR8258 SOC框图"></a><font size=3>2. TLSR8258 SOC框图</font></h2><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230100733856.png" alt="image-20231230100733856" style="zoom:50%;" />

<p>具体的外设和介绍可以看芯片手册。</p>
<h1 id="二、开发环境搭建"><a href="#二、开发环境搭建" class="headerlink" title="二、开发环境搭建"></a><font size=3>二、开发环境搭建</font></h1><h2 id="1-SDK下载"><a href="#1-SDK下载" class="headerlink" title="1. SDK下载"></a><font size=3>1. SDK下载</font></h2><p>天猫精灵开发SDK网址：<a target="_blank" rel="noopener" href="https://github.com/alibaba-archive/genie-bt-mesh-stack">alibaba-archive&#x2F;genie-bt-mesh-stack: genie-bt-mesh-stack (github.com)</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230101018515.png" alt="image-20231230101018515" style="zoom:25%;" />

<p>当时下载的时候应该是这次提交：<a target="_blank" rel="noopener" href="https://github.com/alibaba-archive/genie-bt-mesh-stack/commit/faf523618a6a2560090fc423222b9db80984bb7a">change for build tg7100b and ch6121evb · alibaba-archive&#x2F;genie-bt-mesh-stack@faf5236 (github.com)</a></p>
<h2 id="2-开发环境"><a href="#2-开发环境" class="headerlink" title="2. 开发环境"></a><font size=3>2. 开发环境</font></h2><p>这里我们需要选择windows开发环境，这是因为天猫精灵开发SDK在编译的时候用到的一些工具在linux下是无法运行的，所以目前来讲使能使用windows。windows下开发环境选择：</p>
<ul>
<li>编辑器：VS Code</li>
<li>编译工具：aos-cube（安装依赖python命令）</li>
<li>SDK：天猫精灵提供</li>
<li>烧录工具：Telink BDT.exe</li>
</ul>
<h2 id="3-环境搭建"><a href="#3-环境搭建" class="headerlink" title="3. 环境搭建"></a><font size=3>3. 环境搭建</font></h2><h3 id="3-1-python安装"><a href="#3-1-python安装" class="headerlink" title="3.1 python安装"></a><font size=3>3.1 python安装</font></h3><h4 id="3-1-1-python下载"><a href="#3-1-1-python下载" class="headerlink" title="3.1.1 python下载"></a><font size=3>3.1.1 python下载</font></h4><p>python可以去官网下载安装程序：<a target="_blank" rel="noopener" href="https://www.python.org/downloads/windows/">Python Releases for Windows | Python.org</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230104230800.png" alt="image-20231230104230800" style="zoom:50%;" />

<h4 id="3-1-2-安装步骤"><a href="#3-1-2-安装步骤" class="headerlink" title="3.1.2 安装步骤"></a><font size=3>3.1.2 安装步骤</font></h4><ul>
<li>（1）双击对应的可执行文件打开</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装python1.png" alt="安装python1" style="zoom: 33%;" />

<ul>
<li>（2）勾选添加环境变量</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装python2.png" alt="安装python2" style="zoom: 67%;" />

<ul>
<li>（3）点击下一步</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装python3.png" alt="安装python3" style="zoom: 67%;" />

<ul>
<li>（4）选择要安装的路径</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装python4.png" alt="安装python4" style="zoom:67%;" />

<ul>
<li>（5）等待安装完毕</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装python5.png" alt="安装python5" style="zoom:67%;" />

<ul>
<li>（6）安装成功提示</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装python6.png" alt="安装python6" style="zoom:67%;" />

<h4 id="3-1-3-验证是否安装成功"><a href="#3-1-3-验证是否安装成功" class="headerlink" title="3.1.3 验证是否安装成功"></a><font size=3>3.1.3 验证是否安装成功</font></h4><p>Win+R打开运行框</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/测试python.png" alt="测试python" style="zoom:67%;" />

<p>然后输入<code>python -V</code>命令，显示版本说明安装成功：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/测试python1.png" alt="测试python1" style="zoom:50%;" />

<h3 id="3-2-aos-cube安装"><a href="#3-2-aos-cube安装" class="headerlink" title="3.2 aos-cube安装"></a><font size=3>3.2 aos-cube安装</font></h3><ul>
<li>（1）<code>python -m pip install --upgrade pip</code></li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube1.png" alt="安装aos cube1" style="zoom:50%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube2.png" alt="安装aos cube2" style="zoom:50%;" />

<ul>
<li>（2）<code>python -m pip install setuptools</code></li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube3.png" alt="安装aos cube3" style="zoom:50%;" />

<ul>
<li>（3）<code>python -m pip install wheel</code></li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube4.png" alt="安装aos cube4" style="zoom:50%;" />

<ul>
<li>（4）<code>python -m pip install aos-cube</code></li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube5.png" alt="安装aos cube5" style="zoom:50%;" />

<ul>
<li>（5）aos-cube 验证安装是否成功</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube6.png" alt="安装aos cube6" style="zoom:50%;" />

<p>然后输入y，可以看到有如下打印信息：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube7.png" alt="安装aos cube7" style="zoom:50%;" />

<ul>
<li>（6）打印版本</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装aos cube8.png" alt="安装aos cube8" style="zoom:50%;" />

<h3 id="3-3-VS-Code"><a href="#3-3-VS-Code" class="headerlink" title="3.3 VS Code"></a><font size=3>3.3 VS Code</font></h3><h4 id="3-3-1-vscode下载"><a href="#3-3-1-vscode下载" class="headerlink" title="3.3.1 vscode下载"></a><font size=3>3.3.1 vscode下载</font></h4><p>我们直接去官网下最新版本就行了：<a target="_blank" rel="noopener" href="https://code.visualstudio.com/">Visual Studio Code - Code Editing. Redefined</a></p>
<h4 id="3-3-2-安装软件"><a href="#3-3-2-安装软件" class="headerlink" title="3.3.2 安装软件"></a><font size=3>3.3.2 安装软件</font></h4><ul>
<li>（1）双击可执行文件</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code.png" alt="安装VS Code" style="zoom: 36%;" />

<ul>
<li>（2）同意协议</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code1.png" alt="安装VS Code1" style="zoom: 80%;" />

<ul>
<li>（3）选择安装位置</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code2.png" alt="安装VS Code2" style="zoom:67%;" />

<ul>
<li>（4）选择下一步</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code3.png" alt="安装VS Code3" style="zoom:80%;" />

<ul>
<li>（5）创建快捷方式，添加环境变量</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code4.png" alt="安装VS Code4" style="zoom:80%;" />

<ul>
<li>（6）点击安装</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code5.png" alt="安装VS Code5" style="zoom:80%;" />

<ul>
<li>（7）安装中……</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code6.png" alt="安装VS Code6" style="zoom:80%;" />

<ul>
<li>（8）安装成功</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/安装VS Code7.png" alt="安装VS Code7" style="zoom:80%;" />

<h4 id="3-3-3-配置VS-Code-中文"><a href="#3-3-3-配置VS-Code-中文" class="headerlink" title="3.3.3 配置VS Code 中文"></a><font size=3>3.3.3 配置VS Code 中文</font></h4><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/VS Code配置1.png" alt="VS Code配置1" style="zoom:50%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/VS Code配置2.png" alt="VS Code配置2" style="zoom:50%;" />

<h4 id="3-3-4-配置VS-Code-C-C-插件"><a href="#3-3-4-配置VS-Code-C-C-插件" class="headerlink" title="3.3.4 配置VS Code C&#x2F;C++插件"></a><font size=3>3.3.4 配置VS Code C&#x2F;C++插件</font></h4><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/VS Code配置3.png" alt="VS Code配置3" style="zoom:50%;" />

<h3 id="3-4-SDK安装"><a href="#3-4-SDK安装" class="headerlink" title="3.4 SDK安装"></a><font size=3>3.4 SDK安装</font></h3><p>sdk就是全面在github下载的，我们选这次提交下的：<a target="_blank" rel="noopener" href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a">alibaba-archive&#x2F;genie-bt-mesh-stack at faf523618a6a2560090fc423222b9db80984bb7a (github.com)</a></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK安装.png" alt="SDK安装" style="zoom:50%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK安装1.png" alt="SDK安装1" style="zoom:50%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK安装2.png" alt="SDK安装2" style="zoom:50%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK安装3.png" alt="SDK安装3" style="zoom: 35%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK安装4.png" alt="SDK安装4" style="zoom:50%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/SDK安装5.png" alt="SDK安装5" style="zoom:50%;" />

<h3 id="3-5-串口驱动安装"><a href="#3-5-串口驱动安装" class="headerlink" title="3.5 串口驱动安装"></a><font size=3>3.5 串口驱动安装</font></h3><p>其实以前装过CH340驱动的话，也可以不用管，或者是自己装一个CH340驱动也行，这里主要是要安装一个USB转串口的驱动。</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口驱动安装1.png" alt="串口驱动安装1" style="zoom: 42%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口驱动安装2.png" alt="串口驱动安装2" style="zoom: 80%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口驱动安装3.png" alt="串口驱动安装3" style="zoom: 80%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口驱动安装4.png" alt="串口驱动安装4" style="zoom: 80%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口驱动安装5.png" alt="串口驱动安装5" style="zoom: 80%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口驱动安装6.png" alt="串口驱动安装6" style="zoom: 80%;" />

<h2 id="4-工程编译"><a href="#4-工程编译" class="headerlink" title="4. 工程编译"></a><font size=3>4. 工程编译</font></h2><h3 id="4-1-查看helloworld工程"><a href="#4-1-查看helloworld工程" class="headerlink" title="4.1 查看helloworld工程"></a><font size=3>4.1 查看helloworld工程</font></h3><p>①、系统时钟配置</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/查看系统时钟.png" alt="查看系统时钟" />

<p>②、串口波特率配置</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/查看波特率配置.png" alt="查看波特率配置" />

<h3 id="4-2-编译工程"><a href="#4-2-编译工程" class="headerlink" title="4.2 编译工程"></a><font size=3>4.2 编译工程</font></h3><p>①、编译命令：<code>aos make bluetooth.helloworld@tc825x</code></p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/生成helloworld程序.png" alt="生成helloworld程序" />

<p>②、生成可执行文件位置</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/生成helloworld程序1.png" alt="生成helloworld程序1" />

<h2 id="5-烧录程序"><a href="#5-烧录程序" class="headerlink" title="5. 烧录程序"></a><font size=3>5. 烧录程序</font></h2><h3 id="5-1-烧录硬件接线"><a href="#5-1-烧录硬件接线" class="headerlink" title="5.1 烧录硬件接线"></a><font size=3>5.1 烧录硬件接线</font></h3><table>
<thead>
<tr>
<th>设备</th>
<th>电源正极</th>
<th>烧录引脚</th>
<th>电源负极你</th>
</tr>
</thead>
<tbody><tr>
<td>烧录器</td>
<td>3V3</td>
<td>SWM</td>
<td>GND</td>
</tr>
<tr>
<td>泰凌微8258</td>
<td>3.3V</td>
<td>PA7</td>
<td>GND</td>
</tr>
</tbody></table>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/硬件接线.jpg" alt="硬件接线" style="zoom: 25%;" />

<h3 id="5-2-烧录工具安装"><a href="#5-2-烧录工具安装" class="headerlink" title="5.2 烧录工具安装"></a><font size=3>5.2 烧录工具安装</font></h3><ul>
<li>（1）解压工具</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具安装1.png" alt="烧录工具安装1"  />

<ul>
<li>（2）打开烧录软件</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具安装2.png" alt="烧录工具安装2" />

<h3 id="5-3-烧录工具使用"><a href="#5-3-烧录工具使用" class="headerlink" title="5.3 烧录工具使用"></a><font size=3>5.3 烧录工具使用</font></h3><ul>
<li>（1）选择烧录设备</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具使用1.png" alt="烧录工具使用1" style="zoom: 33%;" />

<ul>
<li>（2）打开要烧录的文件</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具使用2.png" alt="烧录工具使用2" style="zoom: 33%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具使用3.png" alt="烧录工具使用3" style="zoom:33%;" />

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具使用4.png" alt="烧录工具使用4" style="zoom:33%;" />

<ul>
<li>（3）验证是否识别到蓝牙模块</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具使用5.png" alt="烧录工具使用5" style="zoom:33%;" />

<ul>
<li>（4）烧录程序</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/烧录工具使用6.png" alt="烧录工具使用6" style="zoom:33%;" />

<h2 id="6-程序现象"><a href="#6-程序现象" class="headerlink" title="6. 程序现象"></a><font size=3>6. 程序现象</font></h2><ul>
<li>（1）查看端口号</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/查看端口号.png" alt="查看端口号" style="zoom: 49%;" />

<ul>
<li>（2）打开串口调试工具</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口打印1.png" alt="串口打印1" style="zoom: 38%;" />

<ul>
<li>（3）串口工具配置</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口打印2.png" alt="串口打印2" style="zoom:52%;" />

<ul>
<li>（5）查看打印信息</li>
</ul>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/串口打印3.png" alt="串口打印3" style="zoom:50%;" />

<h1 id="三、硬件控制"><a href="#三、硬件控制" class="headerlink" title="三、硬件控制"></a><font size=3>三、硬件控制</font></h1><h2 id="1-LED控制实验"><a href="#1-LED控制实验" class="headerlink" title="1. LED控制实验"></a><font size=3>1. LED控制实验</font></h2><h3 id="1-1-LED接在哪？"><a href="#1-1-LED接在哪？" class="headerlink" title="1.1 LED接在哪？"></a><font size=3>1.1 LED接在哪？</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/TLSR8258模块资料.png" alt="TLSR8258模块资料" style="zoom: 25%;" />

<p>由上图丝印可知，三个LED灯可以通过跳线帽接在对应的GPIO引脚上：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">Red   : PB4	</span><br><span class="line">Green : PB5</span><br><span class="line">Blue  : PC1</span><br></pre></td></tr></table></figure>

<h3 id="1-2-LED亮灭基本原理"><a href="#1-2-LED亮灭基本原理" class="headerlink" title="1.2 LED亮灭基本原理"></a><font size=3>1.2 LED亮灭基本原理</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230105319303.png" alt="image-20231230105319303" style="zoom:50%;" />



<h3 id="1-3-LED控制代码实现"><a href="#1-3-LED控制代码实现" class="headerlink" title="1.3 LED控制代码实现"></a><font size=3>1.3 LED控制代码实现</font></h3><p>这里是一个基本框架，具体的代码可以看这里：<a target="_blank" rel="noopener" href="https://github.com/sumumm/my-genie-bt-mesh-stack/tree/master/app/example/bluetooth/my_gpio_led">my-genie-bt-mesh-stack&#x2F;app&#x2F;example&#x2F;bluetooth&#x2F;my_gpio_led at master · sumumm&#x2F;my-genie-bt-mesh-stack (github.com)</a></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;gpio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="comment">//填充要用的GPIO引脚</span></span><br><span class="line"><span class="type">gpio_dev_t</span> gpio;</span><br><span class="line">gpio.port = LED_PIN;</span><br><span class="line">gpio.config = OUTPUT_PUSH_PULL;</span><br><span class="line"></span><br><span class="line"><span class="comment">//初始化GPIO引脚</span></span><br><span class="line">hal_gpio_init(&amp;gpio);</span><br><span class="line"></span><br><span class="line"><span class="comment">//输出高电平</span></span><br><span class="line">hal_gpio_output_high(&amp;gpio); </span><br><span class="line"></span><br><span class="line"><span class="comment">//输出低电平</span></span><br><span class="line">hal_gpio_output_low(&amp;gpio);</span><br><span class="line"></span><br><span class="line"><span class="comment">//电平翻转</span></span><br><span class="line">hal_gpio_output_toggle(&amp;gpio);</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h2 id="2-风扇控制实现"><a href="#2-风扇控制实现" class="headerlink" title="2. 风扇控制实现"></a><font size=3>2. 风扇控制实现</font></h2><h3 id="2-1-风扇实物图"><a href="#2-1-风扇实物图" class="headerlink" title="2.1 风扇实物图"></a><font size=3>2.1 风扇实物图</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/风扇.jpg" alt="风扇" style="zoom:25%;" />

<h3 id="2-2-各部分说明"><a href="#2-2-各部分说明" class="headerlink" title="2.2 各部分说明"></a><font size=3>2.2 各部分说明</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/L9110风扇模块.png" alt="L9110风扇模块" style="zoom:50%;" />

<p>我们使用的是L9110H芯片来驱动电机。芯片手册可以看这里：<a target="_blank" rel="noopener" href="https://atta.szlcsc.com/upload/public/pdf/source/20231019/72BD918477321DF913C7E224EE2169A4.pdf">XBLW-L9110 (szlcsc.com)</a></p>
<h3 id="2-3-风扇电机驱动原理"><a href="#2-3-风扇电机驱动原理" class="headerlink" title="2.3 风扇电机驱动原理"></a><font size=3>2.3 风扇电机驱动原理</font></h3><h4 id="2-3-1-L9110芯片特性"><a href="#2-3-1-L9110芯片特性" class="headerlink" title="2.3.1 L9110芯片特性"></a><font size=3>2.3.1 L9110芯片特性</font></h4><ul>
<li><p>控制和驱动电机</p>
</li>
<li><p>两通道推挽式功率放大专用集成电路器件 </p>
</li>
<li><p>电压范围： 2.5V-12V（但是我在使用过程中接了5V，发热特别大，而且驱动状态也不太对，后来就接的3.3V了）。</p>
</li>
<li><p>每通道具有 800mA 连续电流输出能力 输出具有<strong>正转、反转、高阻和刹车</strong>四种状态</p>
</li>
</ul>
<h4 id="2-3-2-L9110引脚定义"><a href="#2-3-2-L9110引脚定义" class="headerlink" title="2.3.2 L9110引脚定义"></a><font size=3>2.3.2 L9110引脚定义</font></h4><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/L9110引脚定义1.png" alt="L9110引脚定义1" style="zoom:50%;" />

<p>各个引脚的含义如下表格：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/L9110引脚定义2.png" alt="L9110引脚定义2" style="zoom:50%;" />

<h4 id="2-3-3-控制电路"><a href="#2-3-3-控制电路" class="headerlink" title="2.3.3 控制电路"></a><font size=3>2.3.3 控制电路</font></h4><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/控制电路.png" alt="控制电路" style="zoom:50%;" />

<p>输入端不同信号对应的状态如下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/引出端波形.png" alt="引出端波形" style="zoom:50%;" />

<p>其实正反转都是我们自己定义的，这里知道这个原理就可以了。<strong>注意：</strong>当输入A或者输入B只有一个悬空的时候，风扇都会转。</p>
<h3 id="2-4-实现风扇控制"><a href="#2-4-实现风扇控制" class="headerlink" title="2.4 实现风扇控制"></a><font size=3>2.4 实现风扇控制</font></h3><h4 id="2-4-1-GPIO引脚选择"><a href="#2-4-1-GPIO引脚选择" class="headerlink" title="2.4.1 GPIO引脚选择"></a><font size=3>2.4.1 GPIO引脚选择</font></h4><p>引脚选择如下，为了控制风速，我们其实可以选择带PWM输出的引脚：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">INA —— PD2</span><br><span class="line">INB —— PD3</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/image-20231230110454170.png" alt="image-20231230110454170" style="zoom:50%;" />

<h4 id="2-4-2-实现PWM相关函数"><a href="#2-4-2-实现PWM相关函数" class="headerlink" title="2.4.2 实现PWM相关函数"></a><font size=3>2.4.2 实现PWM相关函数</font></h4><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">struct</span> &#123;</span></span><br><span class="line"><span class="meta">#<span class="keyword">if</span> defined(BOARD_TC825X)</span></span><br><span class="line">    <span class="type">float</span>    duty_cycle;     <span class="comment">/* 当用泰凌微8258时，周期在0 ~ 1之间 */</span></span><br><span class="line"><span class="meta">#<span class="keyword">else</span></span></span><br><span class="line">    <span class="type">uint32_t</span>    duty_cycle;  <span class="comment">/* 周期 */</span></span><br><span class="line"><span class="meta">#<span class="keyword">endif</span></span></span><br><span class="line">    <span class="type">uint32_t</span> freq;           <span class="comment">/* 频率 */</span></span><br><span class="line">&#125; <span class="type">pwm_config_t</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//PWM引脚初始化</span></span><br><span class="line"><span class="type">int32_t</span> <span class="title function_">hal_pwm_init</span><span class="params">(<span class="type">pwm_dev_t</span> *pwm)</span>;</span><br><span class="line"><span class="comment">//开始PWM波计数</span></span><br><span class="line"><span class="type">int32_t</span> <span class="title function_">hal_pwm_start</span><span class="params">(<span class="type">pwm_dev_t</span> *pwm)</span>;</span><br><span class="line"><span class="comment">//停止PWM波计数</span></span><br><span class="line"><span class="type">int32_t</span> <span class="title function_">hal_pwm_stop</span><span class="params">(<span class="type">pwm_dev_t</span> *pwm)</span>;</span><br><span class="line"><span class="comment">//改变PWM占空比</span></span><br><span class="line"><span class="type">int32_t</span> <span class="title function_">hal_pwm_para_chg</span><span class="params">(<span class="type">pwm_dev_t</span> *pwm, <span class="type">pwm_config_t</span> para)</span>;</span><br><span class="line"><span class="comment">//重置PWM引脚功能</span></span><br><span class="line"><span class="type">int32_t</span> <span class="title function_">hal_pwm_finalize</span><span class="params">(<span class="type">pwm_dev_t</span> *pwm)</span>;</span><br></pre></td></tr></table></figure>

<h4 id="2-4-3-PWM初始化和控制实现"><a href="#2-4-3-PWM初始化和控制实现" class="headerlink" title="2.4.3 PWM初始化和控制实现"></a><font size=3>2.4.3 PWM初始化和控制实现</font></h4><p>源码如下，也可以看这里：<a target="_blank" rel="noopener" href="https://github.com/sumumm/my-genie-bt-mesh-stack/tree/6dcae9c8597bafb3876b71646183ba4cd0056c1d/app/example/bluetooth/my_fan_ctl">my-genie-bt-mesh-stack&#x2F;app&#x2F;example&#x2F;bluetooth&#x2F;my_fan_ctl at 6dcae9c8597bafb3876b71646183ba4cd0056c1d · sumumm&#x2F;my-genie-bt-mesh-stack (github.com)</a></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//引脚 INA = PD2	INB = PD3</span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> INA_PIN     TC825X_GET_PIN_NUM(GPIO_PWM3D2)</span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> INB_PIN     TC825X_GET_PIN_NUM(GPIO_PWM1ND3)</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> DEFAULT_CYCLE       0.0			<span class="comment">//默认占空比</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> PWM_FREQ            300000		<span class="comment">//频率</span></span></span><br><span class="line"></span><br><span class="line"><span class="keyword">typedef</span> <span class="class"><span class="keyword">enum</span> &#123;</span></span><br><span class="line">    FOREWARD,   <span class="comment">//正转</span></span><br><span class="line">    REVERSAL,   <span class="comment">//反转</span></span><br><span class="line">    STOP        <span class="comment">//停止</span></span><br><span class="line">&#125;fan_status;    <span class="comment">//风扇状态</span></span><br><span class="line"></span><br><span class="line"><span class="type">static</span> <span class="type">pwm_dev_t</span> ina,inb;</span><br><span class="line"></span><br><span class="line"><span class="type">static</span> fan_status current_status = FOREWARD;</span><br><span class="line"><span class="type">static</span> <span class="type">float</span> current_speed = DEFAULT_CYCLE;</span><br><span class="line"></span><br><span class="line"><span class="comment">//初始化风扇引脚</span></span><br><span class="line"><span class="type">static</span> <span class="type">u8_t</span> <span class="title function_">fan_init</span><span class="params">(<span class="type">void</span>)</span></span><br><span class="line">&#123;</span><br><span class="line"></span><br><span class="line">    ina.port = INA_PIN;                         <span class="comment">//PD2</span></span><br><span class="line">    ina.config.duty_cycle = DEFAULT_CYCLE;    <span class="comment">//0.0   占空比 0%</span></span><br><span class="line">    ina.config.freq = PWM_FREQ;				</span><br><span class="line">    hal_pwm_init(&amp;ina);</span><br><span class="line">    hal_pwm_start(&amp;ina);</span><br><span class="line"></span><br><span class="line">    inb.port = INB_PIN;                         <span class="comment">//PD3</span></span><br><span class="line">    inb.config.duty_cycle = DEFAULT_CYCLE;    <span class="comment">//0.0   占空比 0%</span></span><br><span class="line">    inb.config.freq = PWM_FREQ;</span><br><span class="line">    hal_pwm_init(&amp;inb);</span><br><span class="line">    hal_pwm_start(&amp;inb);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">&quot;风扇初始化完成\r\n&quot;</span>);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="type">static</span> <span class="type">uint8_t</span> <span class="title function_">fan_ctrl</span><span class="params">(fan_status status, <span class="type">float</span> speed)</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="keyword">if</span>(speed &gt; <span class="number">1</span> || speed &lt; <span class="number">0</span>)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;speed error\r\n&quot;</span>);</span><br><span class="line">        <span class="keyword">return</span> <span class="number">1</span>;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">switch</span>(status)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="keyword">case</span> FOREWARD:      <span class="comment">//正转</span></span><br><span class="line">            hal_pwm_stop(&amp;ina);</span><br><span class="line">            hal_pwm_stop(&amp;inb);</span><br><span class="line">            <span class="comment">//INA   高电平      INB 低电平</span></span><br><span class="line">            ina.config.duty_cycle = speed;    <span class="comment">//0.0   占空比 0%</span></span><br><span class="line">            hal_pwm_para_chg(&amp;ina,ina.config);</span><br><span class="line"></span><br><span class="line">            inb.config.duty_cycle = <span class="number">0</span>;          <span class="comment">//0.0   占空比 0%</span></span><br><span class="line">            hal_pwm_para_chg(&amp;inb,inb.config);</span><br><span class="line">            <span class="comment">//开始PWM波输出</span></span><br><span class="line">            hal_pwm_start(&amp;ina);</span><br><span class="line">            hal_pwm_start(&amp;inb);</span><br><span class="line"></span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">case</span> REVERSAL:      <span class="comment">//翻转</span></span><br><span class="line">            hal_pwm_stop(&amp;ina);</span><br><span class="line">            hal_pwm_stop(&amp;inb);</span><br><span class="line">            <span class="comment">//INA   低电平      INB 高电平</span></span><br><span class="line">            ina.config.duty_cycle = <span class="number">0</span>;              <span class="comment">//0.0   占空比 0%</span></span><br><span class="line">            hal_pwm_para_chg(&amp;ina,ina.config);</span><br><span class="line">            inb.config.duty_cycle = speed; </span><br><span class="line">            hal_pwm_para_chg(&amp;inb,inb.config);</span><br><span class="line">            <span class="comment">//开始PWM波输出</span></span><br><span class="line">            hal_pwm_start(&amp;inb);</span><br><span class="line">            hal_pwm_start(&amp;ina);    </span><br><span class="line"></span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line">        <span class="keyword">case</span> STOP:</span><br><span class="line">            hal_pwm_stop(&amp;ina);</span><br><span class="line">            hal_pwm_stop(&amp;inb);</span><br><span class="line"></span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">default</span>:</span><br><span class="line">            <span class="built_in">printf</span>(<span class="string">&quot;status error\r\n&quot;</span>);</span><br><span class="line">            <span class="keyword">return</span> <span class="number">1</span>;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">	current_status = status;</span><br><span class="line">	current_speed = speed;</span><br><span class="line">	<span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>功能实现：20%占空比正转3秒，停顿3秒，再30%占空比反转3秒，停顿3秒：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">int</span> <span class="title function_">application_start</span><span class="params">(<span class="type">int</span> argc, <span class="type">char</span> **argv)</span></span><br><span class="line">&#123;</span><br><span class="line">    genie_init();</span><br><span class="line">    aos_msleep(<span class="number">5000</span>);</span><br><span class="line">    <span class="keyword">while</span>(<span class="number">1</span>)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;正转3秒\r\n&quot;</span>);</span><br><span class="line">        fan_ctrl(FOREWARD, <span class="number">0.2</span>);</span><br><span class="line">        aos_msleep(<span class="number">3000</span>);</span><br><span class="line"></span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;暂停3秒\r\n&quot;</span>);</span><br><span class="line">        fan_ctrl(STOP, <span class="number">0</span>);</span><br><span class="line">        aos_msleep(<span class="number">3000</span>);</span><br><span class="line"></span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;反转3秒\r\n&quot;</span>);</span><br><span class="line">        fan_ctrl(REVERSAL, <span class="number">0.3</span>);</span><br><span class="line">        aos_msleep(<span class="number">3000</span>);</span><br><span class="line"></span><br><span class="line">        <span class="built_in">printf</span>(<span class="string">&quot;暂停3秒\r\n&quot;</span>);</span><br><span class="line">        fan_ctrl(STOP, <span class="number">0</span>);</span><br><span class="line">        aos_msleep(<span class="number">3000</span>);</span><br><span class="line">    </span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<h2 id="3-按键中断实现"><a href="#3-按键中断实现" class="headerlink" title="3. 按键中断实现 "></a><font size=3>3. 按键中断实现 </font></h2><h3 id="3-1-开发板中的按键"><a href="#3-1-开发板中的按键" class="headerlink" title="3.1 开发板中的按键"></a><font size=3>3.1 开发板中的按键</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/按键.jpg" alt="按键" style="zoom: 25%;" />

<h3 id="3-2-万用表实测引脚"><a href="#3-2-万用表实测引脚" class="headerlink" title="3.2 万用表实测引脚"></a><font size=3>3.2 万用表实测引脚</font></h3><p>由于这个模块没有原理图，硬件上的一些按键要用万用表去测量。测量后可以知道引脚编号如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">SW3 = PA0 // 用作了串口接收</span><br><span class="line">SW2 = PC4</span><br><span class="line">SW1 = PC3</span><br></pre></td></tr></table></figure>



<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV04-%E5%A4%A9%E7%8C%AB%E8%93%9D%E7%89%99Mesh%E9%A1%B9%E7%9B%AE-02-%E5%88%9D%E7%BA%A7%E5%BC%80%E5%8F%91-02-%E7%AB%AF-%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91/img/万用表使用.jpg" alt="万用表使用" style="zoom: 25%;" />

<h3 id="3-3-实现按键触发"><a href="#3-3-实现按键触发" class="headerlink" title="3.3 实现按键触发"></a><font size=3>3.3 实现按键触发</font></h3><p>在 platform&#x2F;mcu&#x2F;tc32_825x&#x2F;vendor&#x2F;common&#x2F;alios_app_config.h 文件里开启宏GPIO中断宏：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">define</span> GPIO_IRQ_ENABLE					1</span></span><br></pre></td></tr></table></figure>

<p>功能实现：按下SW1风扇加速、按下SW2风扇减速，按键SW3不使用。代码如下，也可以看这里：<a target="_blank" rel="noopener" href="https://github.com/sumumm/my-genie-bt-mesh-stack/tree/e02b131cc36942ed8a5eed408d08d5f32edc5f37/app/example/bluetooth/my_fan_ctl">my-genie-bt-mesh-stack&#x2F;app&#x2F;example&#x2F;bluetooth&#x2F;my_fan_ctl at e02b131cc36942ed8a5eed408d08d5f32edc5f37 · sumumm&#x2F;my-genie-bt-mesh-stack (github.com)</a></p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;gpio.h&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> KEY_SW1     TC825X_GET_PIN_NUM(GPIO_PC3)</span></span><br><span class="line"><span class="meta">#<span class="keyword">define</span> KEY_SW2     TC825X_GET_PIN_NUM(GPIO_PC4)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="type">static</span> <span class="type">gpio_dev_t</span> key_sw1,key_sw2;</span><br><span class="line"></span><br><span class="line"><span class="type">static</span> fan_status current_status = FOREWARD;	<span class="comment">//初始化为正转</span></span><br><span class="line"><span class="type">static</span> <span class="type">float</span> current_speed = DEFAULT_CYCLE;		<span class="comment">//占空比默认为0</span></span><br><span class="line"></span><br><span class="line"><span class="type">void</span> <span class="title function_">key_irq_handler</span><span class="params">(<span class="type">void</span> *arg)</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="type">gpio_dev_t</span> *key = (<span class="type">gpio_dev_t</span> *)arg;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">switch</span>(key-&gt;port)</span><br><span class="line">    &#123;</span><br><span class="line">        <span class="keyword">case</span> KEY_SW1:		<span class="comment">//PC3</span></span><br><span class="line">            current_speed += <span class="number">0.1</span>;</span><br><span class="line">            <span class="keyword">if</span>(current_speed &gt; <span class="number">1</span>)</span><br><span class="line">                current_speed = <span class="number">1</span>;</span><br><span class="line">            <span class="built_in">printf</span>(<span class="string">&quot;KEY_SW1触发\r\n&quot;</span>);</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">case</span> KEY_SW2:		<span class="comment">//PC4</span></span><br><span class="line">            current_speed -= <span class="number">0.1</span>;</span><br><span class="line">            <span class="keyword">if</span>(current_speed &lt; <span class="number">0</span>)</span><br><span class="line">                current_speed = <span class="number">0</span>;</span><br><span class="line">            <span class="built_in">printf</span>(<span class="string">&quot;KEY_SW2触发\r\n&quot;</span>);</span><br><span class="line">            <span class="keyword">break</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">default</span>:</span><br><span class="line">            <span class="keyword">return</span> ;</span><br><span class="line"></span><br><span class="line">    &#125;</span><br><span class="line">    <span class="comment">//printf未实现打印浮点类型</span></span><br><span class="line">    <span class="type">uint8_t</span> tmp = (<span class="type">uint8_t</span>)(current_speed*<span class="number">100</span>);</span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">&quot;current_status = %d,current_speed = %u%%\r\n&quot;</span>,current_status,tmp);</span><br><span class="line">    fan_ctrl(current_status,current_speed);</span><br><span class="line">    <span class="keyword">return</span> ;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 由于没有原理图，所以这里按键中断触发选择了下降沿，因为肯定上升下降沿都有</span></span><br><span class="line"><span class="type">static</span> <span class="type">uint8_t</span> <span class="title function_">key_init</span><span class="params">(<span class="type">void</span>)</span></span><br><span class="line">&#123;</span><br><span class="line">    <span class="comment">//引脚初始化</span></span><br><span class="line">    key_sw1.port = KEY_SW1;			<span class="comment">//PC3</span></span><br><span class="line">    key_sw1.config = INPUT_PULL_UP;</span><br><span class="line">    hal_gpio_init(&amp;key_sw1);</span><br><span class="line">    <span class="comment">//开启下降沿触发中断</span></span><br><span class="line">    hal_gpio_enable_irq(&amp;key_sw1, IRQ_TRIGGER_FALLING_EDGE, key_irq_handler,&amp;key_sw1);</span><br><span class="line"></span><br><span class="line">    key_sw2.port = KEY_SW2;			<span class="comment">//PC4</span></span><br><span class="line">    key_sw2.config = INPUT_PULL_UP;</span><br><span class="line">    hal_gpio_init(&amp;key_sw2);</span><br><span class="line">    <span class="comment">//开启下降沿触发中断</span></span><br><span class="line">    hal_gpio_enable_irq(&amp;key_sw2, IRQ_TRIGGER_FALLING_EDGE, key_irq_handler,&amp;key_sw2);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    <span class="built_in">printf</span>(<span class="string">&quot;初始化按键\r\n&quot;</span>);</span><br><span class="line"></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/1dba287.html">LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2024年01月07日 - 11:45</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/1dba287.html" title="LV04-天猫蓝牙Mesh项目-02-初级开发-02-端-硬件开发">https://sumumm.github.io/post/1dba287.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" rel="tag"><i class="fa fa-tag"></i> LV21-天猫精灵IOT</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/2f482997.html" rel="prev" title="LV04-天猫蓝牙Mesh项目-02-初级开发-03-云-天猫精灵生活平台">
                  <i class="fa fa-angle-left"></i> LV04-天猫蓝牙Mesh项目-02-初级开发-03-云-天猫精灵生活平台
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/428a5b3e.html" rel="next" title="LV04-天猫蓝牙Mesh项目-02-初级开发-01-课程简介">
                  LV04-天猫蓝牙Mesh项目-02-初级开发-01-课程简介 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
